module.exports = function ({User, Article, ArticleTag, Admin, Menu, Role, AdminProfile}) {
  User.hasMany(Article);
  Article.User/*关联创建时有用*/ = Article.belongsTo(User);

  ArticleTag.belongsToMany(Article, {through: 'article_articletag'});
  Article.belongsToMany(ArticleTag, {through: 'article_articletag'});

  Admin.AdminProfile = Admin.hasOne(AdminProfile);
  AdminProfile.Admin = AdminProfile.belongsTo(Admin);

  Admin.belongsToMany(Role, {through: 'admin_role'});
  Role.belongsToMany(Admin, {through: 'admin_role'});

  Menu.belongsToMany(Role, {through: 'role_menu'});
  Role.belongsToMany(Menu, {through: 'role_menu'});
};
